package com.study.zk.producer.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @GetMapping("/")
    public List<HashMap<String, Object>> getAllGoods(){
        ArrayList<HashMap<String, Object>> goodList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            HashMap<String, Object> good = new HashMap<>(1);
            good.put("商品编号：" + (i + 100), "商品");
            goodList.add(good);
        }
        return goodList;
    }

}
